<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class ProjectMemberRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 新增项目成员的表单验证
     *
     * @return array
     */
    public function rules()
    {
//        return array();

        return [
            //
            'name' => 'required',
            'project_id' => 'required',
            'is_leader' => 'required|integer',
            'photo' => 'required',
        ];
    }

    public function attributes()
    {
        $attributes = array(

            'name'             => '成员名',
            'project_id'        => '项目ID',
            'is_leader'        => '成员身份',
            'photo'            => '成员头像',
            
        );
//        return array();

        return $attributes;
    }

    public function messages()
    {
        $messages = [
            'required' => ':attribute为必填选项',
            'integer'  => ':attribute必须为数字',
        ];

        return $messages;
    }
}
